package com.baox.agridata.synchronous.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class DicDataTrun {

    public static Integer UnitIDTrun(Integer p_oldID){
        Integer l_newID = null;

        switch (p_oldID){
            case 1:
                l_newID = 1301;
                break;
            case 2:
                l_newID = 1302;
                break;
            case 3:
                l_newID = 1303;
                break;
            case 4:
                l_newID = 1304;
                break;
            case 5:
                l_newID = 1305;
                break;
            case 6:
                l_newID = 1306;
                break;
            case 7:
                l_newID = 1307;
                break;
            case 8:
                l_newID = 1308;
                break;
            case 9:
                l_newID = 1309;
                break;
            case 10:
                l_newID = 1310;
                break;
            case 11:
                l_newID = 1311;
                break;
            case 12:
                l_newID = 1312;
                break;
            case 13:
                l_newID = 1313;
                break;
            case 14:
                l_newID = 1314;
                break;
            case 15:
                l_newID = 1315;
                break;
            case 16:
                l_newID = 1316;
                break;
            default:
                break;
        }

        return l_newID;
    }

    public static Integer UnitIDNewToOld(Integer p_NewID){
        Integer l_oldID = null;

        switch (p_NewID){
            case 1301:
                l_oldID = 1;
                break;
            case 1302:
                l_oldID = 2;
                break;
            case 1303:
                l_oldID = 3;
                break;
            case 1304:
                l_oldID = 4;
                break;
            case 1305:
                l_oldID = 5;
                break;
            case 1306:
                l_oldID = 6;
                break;
            case 1307:
                l_oldID = 7;
                break;
            case 1308:
                l_oldID = 8;
                break;
            case 1309:
                l_oldID = 9;
                break;
            case 1310:
                l_oldID = 10;
                break;
            case 1311:
                l_oldID = 11;
                break;
            case 1312:
                l_oldID = 12;
                break;
            case 1313:
                l_oldID = 13;
                break;
            case 1314:
                l_oldID = 14;
                break;
            case 1315:
                l_oldID = 15;
                break;
            case 1316:
                l_oldID = 16;
                break;
            default:
                break;
        }

        return l_oldID;
    }

    public static Map UnitIDToUnitJson(Integer p_oldID){
        Map l_newJson = new HashMap();

        switch (p_oldID){
            case 1:
                l_newJson.put("key",1301);
                l_newJson.put("Name","头");
                break;
            case 2:
                l_newJson.put("key",1302);
                l_newJson.put("Name","只");
                break;
            case 3:
                l_newJson.put("key",1303);
                l_newJson.put("Name","匹");
                break;
            case 4:
                l_newJson.put("key",1304);
                l_newJson.put("Name","羽");
                break;
            case 5:
                l_newJson.put("key",1305);
                l_newJson.put("Name","公斤");
                break;
            case 6:
                l_newJson.put("key",1306);
                l_newJson.put("Name","吨");
                break;
            case 7:
                l_newJson.put("key",1307);
                l_newJson.put("Name","张");
                break;
            case 8:
                l_newJson.put("key",1308);
                l_newJson.put("Name","枚");
                break;
            case 9:
                l_newJson.put("key",1309);
                l_newJson.put("Name","箱");
                break;
            case 10:
                l_newJson.put("key",1310);
                l_newJson.put("Name","支");
                break;
            case 11:
                l_newJson.put("key",1311);
                l_newJson.put("Name","剂");
                break;
            case 12:
                l_newJson.put("key",1312);
                l_newJson.put("Name","毫升");
                break;
            case 13:
                l_newJson.put("key",1313);
                l_newJson.put("Name","尾");
                break;
            case 14:
                l_newJson.put("key",1314);
                l_newJson.put("Name","万尾");
                break;
            case 15:
                l_newJson.put("key",1315);
                l_newJson.put("Name","粒");
                break;
            case 16:
                l_newJson.put("key",1316);
                l_newJson.put("Name","万粒");
                break;
            default:
                l_newJson = null;
                break;
        }

        return l_newJson;
    }

    public static Map UnitByName(String p_Name){
        Map l_newJson = new HashMap();

        switch (p_Name){
            case "头":
                l_newJson.put("key",1301);
                l_newJson.put("Name","头");
                break;
            case "只":
                l_newJson.put("key",1302);
                l_newJson.put("Name","只");
                break;
            case "匹":
                l_newJson.put("key",1303);
                l_newJson.put("Name","匹");
                break;
            case "羽":
                l_newJson.put("key",1304);
                l_newJson.put("Name","羽");
                break;
            case "公斤":
            case "千克":
            case "千克(公斤)":
            case "千克 (公斤 )":
                l_newJson.put("key",1305);
                l_newJson.put("Name","公斤");
                break;
            case "吨":
                l_newJson.put("key",1306);
                l_newJson.put("Name","吨");
                break;
            case "张":
                l_newJson.put("key",1307);
                l_newJson.put("Name","张");
                break;
            case "枚":
                l_newJson.put("key",1308);
                l_newJson.put("Name","枚");
                break;
            case "箱":
                l_newJson.put("key",1309);
                l_newJson.put("Name","箱");
                break;
            case "支":
                l_newJson.put("key",1310);
                l_newJson.put("Name","支");
                break;
            case "剂":
                l_newJson.put("key",1311);
                l_newJson.put("Name","剂");
                break;
            case "毫升":
                l_newJson.put("key",1312);
                l_newJson.put("Name","毫升");
                break;
            case "尾":
                l_newJson.put("key",1313);
                l_newJson.put("Name","尾");
                break;
            case "万尾":
                l_newJson.put("key",1314);
                l_newJson.put("Name","万尾");
                break;
            case "粒":
                l_newJson.put("key",1315);
                l_newJson.put("Name","粒");
                break;
            case "万粒":
                l_newJson.put("key",1316);
                l_newJson.put("Name","万粒");
                break;
            default:
                l_newJson = null;
                break;
        }

        return l_newJson;
    }

    public static String UnitNewToOld(Integer p_NewID){
        String l_oldStr = null;

        switch (p_NewID){
            case 1301:
                l_oldStr = "头";
                break;
            case 1302:
                l_oldStr = "只";
                break;
            case 1303:
                l_oldStr = "匹";
                break;
            case 1304:
                l_oldStr = "羽";
                break;
            case 1305:
                l_oldStr = "公斤";
                break;
            case 1306:
                l_oldStr = "吨";
                break;
            case 1307:
                l_oldStr = "张";
                break;
            case 1308:
                l_oldStr = "枚";
                break;
            case 1309:
                l_oldStr = "箱";
                break;
            case 1310:
                l_oldStr = "支";
                break;
            case 1311:
                l_oldStr = "剂";
                break;
            case 1312:
                l_oldStr = "毫升";
                break;
            case 1313:
                l_oldStr = "尾";
                break;
            case 1314:
                l_oldStr = "万尾";
                break;
            case 1315:
                l_oldStr = "粒";
                break;
            case 1316:
                l_oldStr = "万粒";
                break;
            default:
                break;
        }

        return l_oldStr;
    }

    public static Integer PlaceTypeID(Integer p_oldID){
        Integer l_newID = null;

        switch (p_oldID){
            case 1:
                l_newID = 2202;
                break;
            case 2:
                l_newID = 2203;
                break;
            case 3:
                l_newID = 2204;
                break;
            case 4:
                l_newID = 2201;
                break;
            case 5:
                l_newID = 2205;
                break;
            case 6:
                l_newID = 2206;
                break;
            case 7:
                l_newID = 2207;
                break;
            case 8:
                l_newID = 2208;
                break;
            case 9:
                l_newID = 2209;
                break;
            default:
                break;
        }

        return l_newID;
    }

    public static Integer PlaceTypeIDNewToOld(Integer p_newID){
        Integer l_oldID = null;

        switch (p_newID){
            case 2202:
                l_oldID = 1;
                break;
            case 2203:
                l_oldID = 2;
                break;
            case 2204:
                l_oldID = 3;
                break;
            case 2201:
                l_oldID = 4;
                break;
            case 2205:
                l_oldID = 5;
                break;
            case 2206:
                l_oldID = 6;
                break;
            case 2207:
                l_oldID = 7;
                break;
            case 2208:
                l_oldID = 8;
                break;
            case 2209:
                l_oldID = 9;
                break;
            default:
                l_oldID = 6;
                break;
        }

        return l_oldID;
    }

    public static Map PlaceType(Integer p_oldID){
        Map l_PlaceType = new HashMap();

        switch (p_oldID){
            case 1:
                l_PlaceType.put("key",2202);
                l_PlaceType.put("Name","养殖场");
                break;
            case 2:
                l_PlaceType.put("key",2203);
                l_PlaceType.put("Name","屠宰场");
                break;
            case 3:
                l_PlaceType.put("key",2204);
                l_PlaceType.put("Name","动物交易市场");
                break;
            case 4:
                l_PlaceType.put("key",2201);
                l_PlaceType.put("Name","养殖户/村");
                break;
            case 5:
                l_PlaceType.put("key",2205);
                l_PlaceType.put("Name","养殖小区");
                break;
            case 6:
                l_PlaceType.put("key",2206);
                l_PlaceType.put("Name","其它");
                break;
            case 7:
                l_PlaceType.put("key",2207);
                l_PlaceType.put("Name","冷库/产品销售场所");
                break;
            case 8:
                l_PlaceType.put("key",2208);
                l_PlaceType.put("Name","动物产品加工厂");
                break;
            case 9:
                l_PlaceType.put("key",2209);
                l_PlaceType.put("Name","无害化处理场");
                break;
            default:
                l_PlaceType.put("key",2206);
                l_PlaceType.put("Name","其它");
                break;
        }

        return l_PlaceType;
    }

    public static Map PlaceTypeByName(String p_Name){
        Map l_PlaceType = new HashMap();

        switch (p_Name){
            case "养殖场":
                l_PlaceType.put("key",2202);
                l_PlaceType.put("Name","养殖场");
                break;
            case "屠宰场":
                l_PlaceType.put("key",2203);
                l_PlaceType.put("Name","屠宰场");
                break;
            case "动物交易市场":
                l_PlaceType.put("key",2204);
                l_PlaceType.put("Name","动物交易市场");
                break;
            case "养殖户/村":
                l_PlaceType.put("key",2201);
                l_PlaceType.put("Name","养殖户/村");
                break;
            case "养殖小区":
                l_PlaceType.put("key",2205);
                l_PlaceType.put("Name","养殖小区");
                break;
            case "其它":
                l_PlaceType.put("key",2206);
                l_PlaceType.put("Name","其它");
                break;
            case "冷库/产品销售场所":
                l_PlaceType.put("key",2207);
                l_PlaceType.put("Name","冷库/产品销售场所");
                break;
            case "动物产品加工厂":
                l_PlaceType.put("key",2208);
                l_PlaceType.put("Name","动物产品加工厂");
                break;
            case "无害化处理场":
                l_PlaceType.put("key",2209);
                l_PlaceType.put("Name","无害化处理场");
                break;
            default:
                l_PlaceType = null;
                break;
        }

        return l_PlaceType;
    }

    public static String PlaceTypeNewToOld(Integer p_NewID){
        String l_oldStr = "";

        switch (p_NewID){
            case 2202:
                l_oldStr = "养殖场";
                break;
            case 2203:
                l_oldStr = "屠宰场";
                break;
            case 2204:
                l_oldStr = "动物交易市场";
                break;
            case 2201:
                l_oldStr = "养殖户/村";
                break;
            case 2205:
                l_oldStr = "养殖小区";
                break;
            case 2206:
            case 2210:
                l_oldStr = "其它";
                break;
            case 2207:
                l_oldStr = "冷库/产品销售场所";
                break;
            case 2208:
                l_oldStr = "动物产品加工厂";
                break;
            case 2209:
                l_oldStr = "无害化处理场";
                break;
            default:
                break;
        }

        return l_oldStr;
    }

    public static Integer TransportTypeID(Integer p_oldID){
        Integer l_newID = null;

        switch (p_oldID){
            case 1:
                l_newID = 1501;
                break;
            case 2:
                l_newID = 1502;
                break;
            case 3:
                l_newID = 1503;
                break;
            case 4:
                l_newID = 1504;
                break;
            default:
                break;
        }

        return l_newID;
    }

    public static Integer TransportTypeIDNewToOld(Integer p_newID){
        Integer l_oldID = null;

        switch (p_newID){
            case 1501:
                l_oldID = 1;
                break;
            case 1502:
                l_oldID = 2;
                break;
            case 1503:
                l_oldID = 3;
                break;
            case 1504:
                l_oldID = 4;
                break;
            default:
                break;
        }

        return l_oldID;
    }

    public static Map TransportType(Integer p_oldID){
        Map l_TransportType = new HashMap();

        switch (p_oldID){
            case 1:
                l_TransportType.put("key",1501);
                l_TransportType.put("Name","道路");
                break;
            case 2:
                l_TransportType.put("key",1502);
                l_TransportType.put("Name","铁路");
                break;
            case 3:
                l_TransportType.put("key",1503);
                l_TransportType.put("Name","水路");
                break;
            case 4:
                l_TransportType.put("key",1504);
                l_TransportType.put("Name","航空");
                break;
            default:
                l_TransportType = null;
                break;
        }

        return l_TransportType;
    }

    public static Map TransportTypeByName(String p_Name){
        Map l_TransportType = new HashMap();

        switch (p_Name){
            case "道路":
            case "公路":
                l_TransportType.put("key",1501);
                l_TransportType.put("Name","道路");
                break;
            case "铁路":
                l_TransportType.put("key",1502);
                l_TransportType.put("Name","铁路");
                break;
            case "水路":
                l_TransportType.put("key",1503);
                l_TransportType.put("Name","水路");
                break;
            case "航空":
                l_TransportType.put("key",1504);
                l_TransportType.put("Name","航空");
                break;
            default:
                l_TransportType = null;
                break;
        }

        return l_TransportType;
    }

    public static String TransportTypeNewToOld(Integer p_newID){
        String l_oldStr = "";

        switch (p_newID){
            case 1:
                l_oldStr = "道路";
                break;
            case 2:
                l_oldStr = "铁路";
                break;
            case 3:
                l_oldStr = "水路";
                break;
            case 4:
                l_oldStr = "航空";
                break;
            default:
                break;
        }

        return l_oldStr;
    }

    public static Integer ValidityDaysID(Integer p_oldID){
        Integer l_newID = null;

        switch (p_oldID){
            case 1:
                l_newID = 1401;
                break;
            case 2:
                l_newID = 1402;
                break;
            case 3:
                l_newID = 1403;
                break;
            case 4:
                l_newID = 1404;
                break;
            case 5:
                l_newID = 1405;
                break;
            case 6:
                l_newID = 1406;
                break;
            case 7:
                l_newID = 1407;
                break;
            case 8:
                l_newID = 1408;
                break;
            default:
                break;
        }

        return l_newID;
    }

    public static Integer ValidityDaysIDNewToOld(Integer p_newID){
        Integer l_oldID = null;

        switch (p_newID){
            case 1401:
                l_oldID = 1;
                break;
            case 1402:
                l_oldID = 2;
                break;
            case 1403:
                l_oldID = 3;
                break;
            case 1404:
                l_oldID = 4;
                break;
            case 1405:
                l_oldID = 5;
                break;
            case 1406:
                l_oldID = 6;
                break;
            case 1407:
                l_oldID = 7;
                break;
            case 1408:
                l_oldID = 8;
                break;
            default:
                break;
        }

        return l_oldID;
    }

    public static Map ValidityDays(Integer p_oldID){
        Map l_ValidityDays = new HashMap();

        switch (p_oldID){
            case 1:
                l_ValidityDays.put("key",1401);
                l_ValidityDays.put("Name","壹");
                break;
            case 2:
                l_ValidityDays.put("key",1402);
                l_ValidityDays.put("Name","贰");
                break;
            case 3:
                l_ValidityDays.put("key",1403);
                l_ValidityDays.put("Name","叁");
                break;
            case 4:
                l_ValidityDays.put("key",1404);
                l_ValidityDays.put("Name","肆");
                break;
            case 5:
                l_ValidityDays.put("key",1405);
                l_ValidityDays.put("Name","伍");
                break;
            case 6:
                l_ValidityDays.put("key",1406);
                l_ValidityDays.put("Name","陆");
                break;
            case 7:
                l_ValidityDays.put("key",1407);
                l_ValidityDays.put("Name","柒");
                break;
            case 8:
                l_ValidityDays.put("key",1408);
                l_ValidityDays.put("Name","壹佰捌拾");
                break;
            default:
                l_ValidityDays = null;
                break;
        }

        return l_ValidityDays;
    }

    public static Map ValidityDaysByName(String p_Name){
        Map l_ValidityDays = new HashMap();

        switch (p_Name){
            case "壹":
                l_ValidityDays.put("key",1401);
                l_ValidityDays.put("Name","壹");
                break;
            case "贰":
                l_ValidityDays.put("key",1402);
                l_ValidityDays.put("Name","贰");
                break;
            case "叁":
                l_ValidityDays.put("key",1403);
                l_ValidityDays.put("Name","叁");
                break;
            case "肆":
                l_ValidityDays.put("key",1404);
                l_ValidityDays.put("Name","肆");
                break;
            case "伍":
                l_ValidityDays.put("key",1405);
                l_ValidityDays.put("Name","伍");
                break;
            case "陆":
                l_ValidityDays.put("key",1406);
                l_ValidityDays.put("Name","陆");
                break;
            case "柒":
                l_ValidityDays.put("key",1407);
                l_ValidityDays.put("Name","柒");
                break;
            case "壹佰捌拾":
                l_ValidityDays.put("key",1408);
                l_ValidityDays.put("Name","壹佰捌拾");
                break;
            default:
                l_ValidityDays = null;
                break;
        }

        return l_ValidityDays;
    }

    public static String ValidityDaysNewToOld(Integer p_newID){
        String l_oldStr = "";

        switch (p_newID){
            case 1:
                l_oldStr = "壹";
                break;
            case 2:
                l_oldStr = "贰";
                break;
            case 3:
                l_oldStr = "叁";
                break;
            case 4:
                l_oldStr = "肆";
                break;
            case 5:
                l_oldStr = "伍";
                break;
            case 6:
                l_oldStr = "陆";
                break;
            case 7:
                l_oldStr = "柒";
                break;
            case 8:
                l_oldStr = "壹佰捌拾";
                break;
            default:
                break;
        }

        return l_oldStr;
    }

    public static Integer PurposeID(Integer p_oldID){
        Integer l_newID = null;

        switch (p_oldID){
            case 1:
                l_newID = 1201;
                break;
            case 2:
                l_newID = 1202;
                break;
            case 3:
                l_newID = 1203;
                break;
            case 4:
                l_newID = 1204;
                break;
            case 5:
                l_newID = 1205;
                break;
            case 6:
                l_newID = 1206;
                break;
            case 7:
                l_newID = 1207;
                break;
            case 8:
                l_newID = 1208;
                break;
            case 9:
                l_newID = 1209;
                break;
            case 10:
                l_newID = 1210;
                break;
            case 11:
                l_newID = 1211;
                break;
            case 12:
                l_newID = 1212;
                break;
            default:
                break;
        }

        return l_newID;
    }

    public static Integer PurposeIDNewToOld(Integer p_newID){
        Integer l_oldID = null;

        switch (p_newID){
            case 1201:
                l_oldID = 1;
                break;
            case 1202:
                l_oldID = 2;
                break;
            case 1203:
                l_oldID = 3;
                break;
            case 1204:
                l_oldID = 4;
                break;
            case 1205:
                l_oldID = 5;
                break;
            case 1206:
                l_oldID = 6;
                break;
            case 1207:
                l_oldID = 7;
                break;
            case 1208:
                l_oldID = 8;
                break;
            case 1209:
                l_oldID = 9;
                break;
            case 1210:
                l_oldID = 10;
                break;
            case 1211:
                l_oldID = 11;
                break;
            case 1212:
                l_oldID = 12;
                break;
            default:
                break;
        }

        return l_oldID;
    }

    public static Map Purpose(Integer p_oldID){
        Map l_Purpose = new HashMap();

        switch (p_oldID){
            case 1:
                l_Purpose.put("key",1201);
                l_Purpose.put("Name","饲养");
                break;
            case 2:
                l_Purpose.put("key",1202);
                l_Purpose.put("Name","屠宰");
                break;
            case 3:
                l_Purpose.put("key",1203);
                l_Purpose.put("Name","种用");
                break;
            case 4:
                l_Purpose.put("key",1204);
                l_Purpose.put("Name","乳用");
                break;
            case 5:
                l_Purpose.put("key",1205);
                l_Purpose.put("Name","役用");
                break;
            case 6:
                l_Purpose.put("key",1206);
                l_Purpose.put("Name","宠用");
                break;
            case 7:
                l_Purpose.put("key",1207);
                l_Purpose.put("Name","实验");
                break;
            case 8:
                l_Purpose.put("key",1208);
                l_Purpose.put("Name","展览");
                break;
            case 9:
                l_Purpose.put("key",1209);
                l_Purpose.put("Name","演出");
                break;
            case 10:
                l_Purpose.put("key",1210);
                l_Purpose.put("Name","比赛");
                break;
            case 11:
                l_Purpose.put("key",1211);
                l_Purpose.put("Name","其它");
                break;
            case 12:
                l_Purpose.put("key",1212);
                l_Purpose.put("Name","交易（销售）");
                break;
            default:
                l_Purpose = null;
                break;
        }

        return l_Purpose;
    }

    public static Map PurposeByName(String p_Name){
        Map l_Purpose = new HashMap();

        switch (p_Name){
            case "饲养":
                l_Purpose.put("key",1201);
                l_Purpose.put("Name","饲养");
                break;
            case "屠宰":
                l_Purpose.put("key",1202);
                l_Purpose.put("Name","屠宰");
                break;
            case "种用":
                l_Purpose.put("key",1203);
                l_Purpose.put("Name","种用");
                break;
            case "乳用":
                l_Purpose.put("key",1204);
                l_Purpose.put("Name","乳用");
                break;
            case "役用":
                l_Purpose.put("key",1205);
                l_Purpose.put("Name","役用");
                break;
            case "宠用":
                l_Purpose.put("key",1206);
                l_Purpose.put("Name","宠用");
                break;
            case "实验":
                l_Purpose.put("key",1207);
                l_Purpose.put("Name","实验");
                break;
            case "展览":
                l_Purpose.put("key",1208);
                l_Purpose.put("Name","展览");
                break;
            case "演出":
                l_Purpose.put("key",1209);
                l_Purpose.put("Name","演出");
                break;
            case "比赛":
                l_Purpose.put("key",1210);
                l_Purpose.put("Name","比赛");
                break;
            case "其它":
                l_Purpose.put("key",1211);
                l_Purpose.put("Name","其它");
                break;
            case "交易（销售）":
                l_Purpose.put("key",1212);
                l_Purpose.put("Name","交易（销售）");
                break;
            default:
                l_Purpose = null;
                break;
        }

        return l_Purpose;
    }

    public static String PurposeNewToOld(Integer p_newID){
        String l_oldStr = "";

        switch (p_newID){
            case 1201:
                l_oldStr = "饲养";
                break;
            case 1202:
                l_oldStr = "屠宰";
                break;
            case 1203:
                l_oldStr = "种用";
                break;
            case 1204:
                l_oldStr = "乳用";
                break;
            case 1205:
                l_oldStr = "役用";
                break;
            case 1206:
                l_oldStr = "宠用";
                break;
            case 1207:
                l_oldStr = "实验";
                break;
            case 1208:
                l_oldStr = "展览";
                break;
            case 1209:
                l_oldStr = "演出";
                break;
            case 1210:
                l_oldStr = "比赛";
                break;
            case 1211:
                l_oldStr = "其它";
                break;
            case 1212:
                l_oldStr = "交易（销售）";
                break;
            default:
                break;
        }

        return l_oldStr;
    }

    public static Integer PrintStatusID(Integer p_oldID){
        Integer l_newID = null;

        switch (p_oldID){
            case 1:
                l_newID = 1801;
                break;
            case 0:
                l_newID = 1802;
                break;
            case -1:
                l_newID = 1803;
                break;
            default:
                break;
        }

        return l_newID;
    }

    public static Integer PrintStatusIDNewToOld(Integer p_newID){
        Integer l_oldID = null;

        switch (p_newID){
            case 1801:
                l_oldID = 1;
                break;
            case 1802:
                l_oldID = 0;
                break;
            case 1803:
                l_oldID = -1;
                break;
            default:
                break;
        }

        return l_oldID;
    }

    public static Integer PrintStatusStrToID(Object p_Obj){
        Integer l_oldID = null;

        if(p_Obj != null && !p_Obj.toString().equals("")){
            if(p_Obj.toString().contains("1801")){
                l_oldID = 1;
            } else if(p_Obj.toString().contains("1802")){
                l_oldID = 0;
            } else if(p_Obj.toString().contains("1803")){
                l_oldID = -1;
            }
        }

        return l_oldID;
    }

    public static Map PrintStatus(Integer p_oldID){
        Map l_PrintStatus = new HashMap();

        switch (p_oldID){
            case 1:
                l_PrintStatus.put("key",1801);
                l_PrintStatus.put("Name","已打印");
                break;
            case 0:
                l_PrintStatus.put("key",1802);
                l_PrintStatus.put("Name","未打印");
                break;
            case -1:
                l_PrintStatus.put("key",1803);
                l_PrintStatus.put("Name","打印失败");
                break;
            default:
                l_PrintStatus = null;
                break;
        }

        return l_PrintStatus;
    }

    public static Integer StatusID(Integer p_oldID){
        Integer l_newID = null;

        switch (p_oldID){
            case 1:
                l_newID = 1701;
                break;
            case 7:
                l_newID = 1704;
                break;
            default:
                break;
        }

        return l_newID;
    }

    public static Integer StatusIDNewToOld(Integer p_newID){
        Integer l_oldID = 1;

        switch (p_newID){
            case 1701:
                l_oldID = 1;
                break;
            case 1704:
                l_oldID = 7;
                break;
            default:
                break;
        }

        return l_oldID;
    }

    public static Map Status(Integer p_oldID){
        Map l_Status = new HashMap();

        switch (p_oldID){
            case 1:
                l_Status.put("key",1701);
                l_Status.put("Name","在途");
                break;
            case 7:
                l_Status.put("key",1704);
                l_Status.put("Name","作废");
                break;
            default:
                l_Status = null;
                break;
        }

        return l_Status;
    }

    public static ArrayList<String> EarTagTurn(String p_EarTagStr){
        ArrayList<String> l_EarTagList = new ArrayList<>();

        if(p_EarTagStr != null && !p_EarTagStr.equals("")){
            String[] temp = p_EarTagStr.split(",");
            if(temp != null && temp.length > 0){
                for (String l_eartag : temp){
                    if(l_eartag != null && !l_eartag.equals("")){
                        l_EarTagList.add(l_eartag);
                    }
                }
            }
        } else {
            l_EarTagList = null;
        }

        return l_EarTagList;
    }

    public static Integer IsOnlineKey(Integer p_oldID){
        Integer l_newID = null;

        switch (p_oldID){
            case 1:
                l_newID = 2301;
                break;
            case 2:
                l_newID = 2302;
                break;
            default:
                break;
        }

        return l_newID;
    }

    public static Integer IsOnlineKeyNTO(Integer p_NewID){
        Integer l_oldD = null;

        switch (p_NewID){
            case 2301:
                l_oldD = 1;
                break;
            case 2302:
                l_oldD = 2;
                break;
            default:
                l_oldD = p_NewID;
                break;
        }

        return l_oldD;
    }

    public static Map IsOnline(Integer p_oldID){
        Map l_new = null;

        switch (p_oldID){
            case 1:
                l_new = new HashMap();
                l_new.put("key",2301);
                l_new.put("Name","在线");
                break;
            case 2:
                l_new = new HashMap();
                l_new.put("key",2302);
                l_new.put("Name","离线");
                break;
            default:
                break;
        }

        return l_new;
    }

    public static Map DataSource(Integer p_oldID){
        Map l_new = null;

        switch (p_oldID){
            case 0:
                l_new = new HashMap();
                l_new.put("key",0);
                l_new.put("Name","客户端直接出证");
                break;
            case 1:
                l_new = new HashMap();
                l_new.put("key",1);
                l_new.put("Name","微信端申报出证");
                break;
            case 2:
                l_new = new HashMap();
                l_new.put("key",2);
                l_new.put("Name","检疫流程运行系统App出证（QuarantineReport）");
                break;
            case 3:
                l_new = new HashMap();
                l_new.put("key",3);
                l_new.put("Name","成都版检疫流程运行系统App");
                break;
            case 4:
                l_new = new HashMap();
                l_new.put("key",4);
                l_new.put("Name","快捷出证App");
                break;
            case 5:
                l_new = new HashMap();
                l_new.put("key",5);
                l_new.put("Name","微信端出证");
                break;
            case 6:
                l_new = new HashMap();
                l_new.put("key",6);
                l_new.put("Name","平台端出证");
                break;
            default:
                break;
        }

        return l_new;
    }

    public static String CarTransType(String p_TransTypeID){
        String l_result = "";

        if(p_TransTypeID != null && !p_TransTypeID.equals("")){
            switch (p_TransTypeID){
                case "1":
                    l_result = "ARRAY[['31ce5f57c4a447e3baef72df3e9aa41a','生猪运输','3101']]";
                    break;
                case "2":
                    l_result = "ARRAY[['f24d7f639b2f46019f9f8c9201297c93','牛运输','3102'],['1488d2298d9e4f3e8a0e3eff475cb448','羊运输','3103']]";
                    break;
                case "3":
                    l_result = "ARRAY[['a43de3e2120b4203a3ae345306ee11f7','禽类运输','3104']]";
                    break;
                case "4":
                    l_result = "ARRAY[['701e74b45adb4a098e0a4ba227263de6','产品运输','3106']]";
                    break;
                case "5":
                    l_result = "ARRAY[['f24d7f639b2f46019f9f8c9201297c93','牛运输','3102']]";
                    break;
                case "6":
                    l_result = "ARRAY[['1488d2298d9e4f3e8a0e3eff475cb448','羊运输','3103']]";
                    break;
                case "7":
                    l_result = "ARRAY[['31ce5f57c4a447e3baef72df3e9aa41a','生猪运输','3101'],['f24d7f639b2f46019f9f8c9201297c93','牛运输','3102']]";
                    break;
                case "8":
                    l_result = "ARRAY[['31ce5f57c4a447e3baef72df3e9aa41a','生猪运输','3101'],['1488d2298d9e4f3e8a0e3eff475cb448','羊运输','3103']]";
                    break;
                case "9":
                    l_result = "ARRAY[['31ce5f57c4a447e3baef72df3e9aa41a','生猪运输','3101'],['f24d7f639b2f46019f9f8c9201297c93','牛运输','3102'],['1488d2298d9e4f3e8a0e3eff475cb448','羊运输','3103']]";
                    break;
                default:
                    l_result = "ARRAY[['fa7f8f8a19f247d9a18b9d49c51ddd04','其他运输','3105']]";
                    break;
            }
        }

        return l_result;
    }

    public static String CarNoColor(String p_NoColor){
        String l_NoColor = "";

        if(p_NoColor != null && !p_NoColor.equals("")){
            if(p_NoColor.equals("1")){
                l_NoColor = "924";
            } else if(p_NoColor.equals("2")){
                l_NoColor = "926";
            } else if(p_NoColor.equals("3")){
                l_NoColor = "925";
            } else if(p_NoColor.equals("4")){
                l_NoColor = "927";
            } else if(p_NoColor.equals("5")){
                l_NoColor = "928";
            } else if(p_NoColor.equals("6")){
                l_NoColor = "929";
            }
        }

        return l_NoColor;
    }

    public static String CarNoColorToOld(String p_CarNoColor){
        String l_NoColor = "";

        if(p_CarNoColor != null && p_CarNoColor != ""){
            if(p_CarNoColor.equals("924")){
                l_NoColor = "1";
            } else if(p_CarNoColor.equals("925")){
                l_NoColor = "3";
            } else if(p_CarNoColor.equals("926")){
                l_NoColor = "2";
            } else if(p_CarNoColor.equals("927")){
                l_NoColor = "4";
            } else if(p_CarNoColor.equals("928")){
                l_NoColor = "5";
            } else if(p_CarNoColor.equals("929")){
                l_NoColor = "6";
            }
        }

        return l_NoColor;
    }


    /**
     * 用途(系统的key转对应农业部的id)
     * @param p_OldCode
     * @return
     */
    public static String PurposeSystemConvertCountry(String p_OldCode){
        String NewCode = "";

        if(p_OldCode != null && !p_OldCode.equals("")){
            switch (p_OldCode){
                case "1202":
                    NewCode = "01";
                    break;
                case "1201":
                    NewCode = "02";
                    break;
                case "1203":
                    NewCode = "05";
                    break;
                case "1204":
                    NewCode = "08";
                    break;
                case "1205":
                    NewCode = "04";
                    break;
                case "1206":
                    NewCode = "06";
                    break;
                case "1207":
                    NewCode = "09";
                    break;
                case "1208":
                    NewCode = "10";
                    break;
                case "1209":
                    NewCode = "11";
                    break;
                case "1210":
                    NewCode = "12";
                    break;
                case "1211":
                    NewCode = "07";
                    break;
                case "1212":
                    NewCode = "13";
                    break;
                default:
                    NewCode = "--";
                    break;
            }
        }

        return NewCode;
    }


    /**
     * 单位
     * @param p_OldCode
     * @return
     */
    public static String UnitSystemConvertCountry(String p_OldCode){
        String NewCode = "";

        if(p_OldCode != null && !p_OldCode.equals("")){
            switch (p_OldCode){
                case "1301":
                    NewCode = "01";
                    break;
                case "1302":
                    NewCode = "02";
                    break;
                case "1303":
                    NewCode = "12";
                    break;
                case "1304":
                    NewCode = "11";
                    break;
                case "1305":
                    NewCode = "04";
                    break;
                case "1307":
                    NewCode = "07";
                    break;
                case "1308":
                    NewCode = "08";
                    break;
                case "1309":
                    NewCode = "13";
                    break;
                case "1311":
                    NewCode = "09";
                    break;
                case "1313":
                    NewCode = "14";
                    break;
                case "1316":
                    NewCode = "10";
                    break;
                default:
                    NewCode = "--";
                    break;
            }
        }

        return NewCode;
    }
}
